import req from "./axioscommon1";
/** 
 * @Description 根据accessToken查询用户信息
 * @param { String }  accessToken 
 */
 export const getUser = (params) => {
    return req({
      baseUrl: 'ssoapi'
    }).get("/api/user/accesstoken/" + params + "/withaccounttype");
  };
  // 获取clientIp
export const getClientIp = () => {
  return req({
    baseUrl: 'clientip'
  }).get('/api/UtilityOpenApi/GetUserIP')
}
export const accountCenterInfo = (params) => {
  return req({
    baseUrl: 'ssoapi'
  }).get("/api/account-center/info?userId=" + params)

}
export const getCookie=(name)=> {
  var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  arr = document.cookie.match(reg)
  if (arr) {
    return unescape(arr[2]);
  } else {
    return null;
  }
}